/**
 * Copyright &copy; 2013-2016 山东易科德软件有限公司 All rights reserved.
 */
package cn.net.ecode.modules.cms.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.net.ecode.common.persistence.Page;
import cn.net.ecode.common.service.CrudService;
import cn.net.ecode.modules.cms.dao.CommentDao;
import cn.net.ecode.modules.cms.entity.Article;
import cn.net.ecode.modules.cms.entity.Comment;

/**
 * 评论Service
 * @author ThinkGem
 * @version 2014-9-16
 */
@Service
@Transactional(readOnly = true)
public class CommentService extends CrudService<CommentDao, Comment> {

	public Page<Comment> findPage(Page<Comment> page, Comment comment) {
		return super.findPage(page, comment);
	}
	
	@Transactional(readOnly = false)
	public void delete(Comment comment, Boolean isRe) {
		comment.setStatus(isRe!=null && isRe ? Article.STATUS_AUDIT : Article.STATUS_DELETE);
		dao.updateStatus(comment);
	}
	
}
